<?php
class User extends Eloquent {

	protected $table = 'user';

    public function register($phone, $nickname, $email, $passwd) {
        $data = array( 'email' => $email, 'passwd' => md5($passwd), 'nickname' => $nickname, 'phone' => $phone, 'create_time' => time());
        return $this->insert($data);
    }

    public function getInfoByEmail($email) {
        return $this->where('email', $email)->first();
    }
}
